irq_ia64.o irq_lsapic.o vhpt.o xenasm.o hyperprivop.o dom_fw.o \
grant_table.o sn_console.o
-# TMP holder to contain *.0 moved out of CONFIG_VTI
-OBJS += vmx_init.o
-
-ifeq ($(CONFIG_VTI),y)
-OBJS += vmx_virt.o vmx_vcpu.o vmx_process.o vmx_vsa.o vmx_ivt.o\
+OBJS += vmx_init.o vmx_virt.o vmx_vcpu.o vmx_process.o vmx_vsa.o vmx_ivt.o\
vmx_phy_mode.o vmx_utility.o vmx_interrupt.o vmx_entry.o vmmu.o \
vtlb.o mmio.o vlsapic.o vmx_hypercall.o mm.o vmx_support.o \
pal_emul.o vmx_irq_ia64.o
-endif
# lib files from xen/arch/ia64/linux/ (linux/arch/ia64/lib)
OBJS += bitop.o clear_page.o flush.o copy_page_mck.o \
########################################
# ia64-specific definitions
-CONFIG_VTI ?= n
+VALIDATE_VT ?= n
ifneq ($(COMPILE_ARCH),$(TARGET_ARCH))
CROSS_COMPILE ?= /usr/local/sp_env/v2.2.5/i686/bin/ia64-unknown-linux-
endif
CFLAGS += -DIA64 -DXEN -DLINUX_2_6
CFLAGS += -ffixed-r13 -mfixed-range=f12-f15,f32-f127
CFLAGS += -w -g
-ifeq ($(CONFIG_VTI),y)
-CFLAGS += -DCONFIG_VTI
+ifeq ($(VALIDATE_VT),y)
+CFLAGS += -DVALIDATE_VT
endif
LDFLAGS := -g
#include <asm/processor.h>
#include <asm/ptrace.h>
#include <public/xen.h>
-#ifdef CONFIG_VTI
#include <asm/tlb.h>
#include <asm/regs.h>
-#endif // CONFIG_VTI
#define task_struct vcpu
BLANK();
-#ifdef CONFIG_VTI
DEFINE(IA64_VPD_BASE_OFFSET, offsetof (struct vcpu, arch.privregs));
DEFINE(IA64_VLSAPIC_INSVC_BASE_OFFSET, offsetof (struct vcpu, arch.insvc[0]));
DEFINE(IA64_VPD_CR_VPTA_OFFSET, offsetof (cr_t, pta));
DEFINE(XXX_THASH_SIZE, sizeof (thash_data_t));
BLANK();
-#endif //CONFIG_VTI
//DEFINE(IA64_SIGCONTEXT_IP_OFFSET, offsetof (struct sigcontext, sc_ip));
//DEFINE(IA64_SIGCONTEXT_AR_BSP_OFFSET, offsetof (struct sigcontext, sc_ar_bsp));
//DEFINE(IA64_SIGCONTEXT_AR_FPSR_OFFSET, offsetof (struct sigcontext, sc_ar_fpsr));
#include <asm/processor.h>
#include <asm/ptrace.h>
#include <public/xen.h>
-#ifdef CONFIG_VTI
#include <asm/tlb.h>
#include <asm/regs.h>
-#endif // CONFIG_VTI
#define task_struct vcpu
#else
mov IA64_KR(CURRENT)=in0 // update "current" application register
#endif
+#ifdef XEN //for VTI domain current is save to 21 of bank0
+ ;;
+ bsw.0
+ ;;
mov r8=r13 // return pointer to previously running task
mov r13=in0 // set "current" pointer
+ mov r21=in0
+ ;;
+ bsw.1
;;
+#else
+ mov r8=r13 // return pointer to previously running task
+ mov r13=in0 // set "current" pointer
+#endif
DO_LOAD_SWITCH_STACK
#ifdef CONFIG_SMP
#ifdef XEN
// new domains are cloned but not exec'ed so switch to user mode here
cmp.ne pKStk,pUStk=r0,r0
-#ifdef CONFIG_VTI
- br.cond.spnt ia64_leave_hypervisor
-#else // CONFIG_VTI
- br.cond.spnt ia64_leave_kernel
-#endif // CONFIG_VTI
-
+ adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
+ ;;
+ ld8 r16 = [r16]
+ ;;
+ cmp.ne p6,p7 = r16, r0
+ (p6) br.cond.spnt ia64_leave_hypervisor
+ (p7) br.cond.spnt ia64_leave_kernel
+ ;;
// adds r16 = IA64_VCPU_FLAGS_OFFSET, r13
// ;;
// ld8 r16 = [r16]
/*
* Switch into virtual mode:
*/
-#if defined(XEN) && defined(CONFIG_VTI)
+#if defined(XEN) && defined(VALIDATE_VT)
movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH\
|IA64_PSR_DI)
#else
;;
// set IVT entry point---can't access I/O ports without it
-#if defined(XEN) && defined(CONFIG_VTI)
+#if defined(XEN) && defined(VALIDATE_VT)
movl r3=vmx_ia64_ivt
#else
movl r3=ia64_ivt
.load_current:
// load the "current" pointer (r13) and ar.k6 with the current task
-#if defined(XEN) && defined(CONFIG_VTI)
+#if defined(XEN) && defined(VALIDATE_VT)
mov r21=r2
;;
bsw.1
RPT(r1), RPT(r2), RPT(r3),
-//#if defined(XEN) && defined(CONFIG_VTI)
#if defined(XEN)
RPT(r4), RPT(r5), RPT(r6), RPT(r7),
-#else //CONFIG_VTI
+#else
RSW(r4), RSW(r5), RSW(r6), RSW(r7),
-#endif //CONFIG_VTI
+#endif
RPT(r8), RPT(r9), RPT(r10), RPT(r11),
RPT(r12), RPT(r13), RPT(r14), RPT(r15),
return reg;
}
-//#if defined(XEN) && defined(CONFIG_VTI)
#if defined(XEN)
void
set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, unsigned long nat)
}
}
-#else // CONFIG_VTI
+#else
static void
set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat)
{
*nat = 0;
return;
}
-#endif // CONFIG_VTI
+#endif
#ifdef XEN
unat = &sw->ar_unat;
} else {
addr = (unsigned long)regs;
-#if defined(XEN) && defined(CONFIG_VTI)
+#if defined(XEN)
unat = ®s->eml_unat;
-#else //CONFIG_VTI
+#else
unat = &sw->caller_unat;
-#endif //CONFIG_VTI
+#endif
}
DPRINT("tmp_base=%lx switch_stack=%s offset=%d\n",
addr, unat==&sw->ar_unat ? "yes":"no", GR_OFFS(regnum));
unat = &sw->ar_unat;
} else {
addr = (unsigned long)regs;
-#if defined(XEN) && defined(CONFIG_VTI)
+#if defined(XEN)
unat = ®s->eml_unat;;
-#else //CONFIG_VTI
+#else
unat = &sw->caller_unat;
-#endif //CONFIG_VTI
+#endif
}
DPRINT("addr_base=%lx offset=0x%x\n", addr, GR_OFFS(regnum));
uregs->ptr is virtual address
uregs->val is pte value
*/
-#ifdef CONFIG_VTI
-int do_mmu_update(mmu_update_t *ureqs,u64 count,u64 *pdone,u64 foreigndom)
+int vmx_do_mmu_update(mmu_update_t *ureqs,u64 count,u64 *pdone,u64 foreigndom)
{
int i,cmd;
u64 mfn, gpfn;
}
return 0;
}
-#endif
* by control panel. Dom0 has gpfn identical to mfn, which doesn't need
* this interface at all.
*/
+#if 0
void
alloc_pmt(struct domain *d)
{
d->arch.pmt = page_to_virt(page);
memset(d->arch.pmt, 0x55, d->max_pages * 8);
}
-
+#endif
/*
* Insert guest TLB to machine TLB.
* data: In TLB format
vcpu_get_gr_nat(vcpu,17,&r33);
vcpu_get_gr_nat(vcpu,18,&r34);
vcpu_get_gr_nat(vcpu,19,&r35);
- ret=do_mmu_update((mmu_update_t*)r32,r33,r34,r35);
+ ret=vmx_do_mmu_update((mmu_update_t*)r32,r33,r34,r35);
vcpu_set_gr(vcpu, 8, ret, 0);
vmx_vcpu_increment_iip(vcpu);
}
-
+/* turn off temporarily, we will merge hypercall parameter convention with xeno, when
+ VTI domain need to call hypercall */
+#if 0
unsigned long __hypercall_create_continuation(
unsigned int op, unsigned int nr_args, ...)
{
va_end(args);
return op;
}
-
+#endif
void hyper_dom_mem_op(void)
{
VCPU *vcpu=current;
static int do_set_shared_page(VCPU *vcpu, u64 gpa)
{
- u64 shared_info, o_info;
+ u64 o_info;
struct domain *d = vcpu->domain;
struct vcpu *v;
if(vcpu->domain!=dom0)
return -EPERM;
- shared_info = __gpa_to_mpa(vcpu->domain, gpa);
o_info = (u64)vcpu->domain->shared_info;
- d->shared_info= (shared_info_t *)__va(shared_info);
+ d->shared_info= (shared_info_t *)domain_mpa_to_imva(vcpu->domain, gpa);
/* Copy existing shared info into new page */
if (o_info) {
}
/* FIXME: only support PMT table continuously by far */
- d->arch.pmt = __va(c->pt_base);
+// d->arch.pmt = __va(c->pt_base);
+
vmx_final_setup_domain(d);
}
}
-#ifdef CONFIG_VTI
/*
* Create a VP on intialized VMX environment.
*/
pte_xen, pte_vhpt);
}
#endif // XEN_DBL_MAPPING
-#endif // CONFIG_VTI
/*
* Initialize VMX envirenment for guest. Only the 1st vp/vcpu
v->arch.privregs = vpd;
vpd->virt_env_vaddr = vm_buffer;
-#ifdef CONFIG_VTI
+ /* Per-domain vTLB and vhpt implementation. Now vmx domain will stick
+ * to this solution. Maybe it can be deferred until we know created
+ * one as vmx domain */
+ v->arch.vtlb = init_domain_tlb(v);
+
/* v->arch.schedule_tail = arch_vmx_do_launch; */
vmx_create_vp(v);
vlsapic_reset(v);
vtm_init(v);
-#endif
/* Other vmx specific initialization work */
}
for (j = io_ranges[i].start;
j < io_ranges[i].start + io_ranges[i].size;
j += PAGE_SIZE)
- map_domain_io_page(d, j);
+ map_domain_page(d, j, io_ranges[i].type);
}
set_bit(ARCH_VMX_CONTIG_MEM, &v->arch.arch_vmx.flags);
#define IRQ_DEBUG 0
-#ifdef CONFIG_VTI
#define vmx_irq_enter() \
add_preempt_count(HARDIRQ_OFFSET);
if ( wake_dom0 && current != dom0 )
vcpu_wake(dom0->vcpu[0]);
}
-#endif
// prepare_if_physical_mode(v);
if(data=vtlb_lookup_ex(vtlb, vrr.rid, vadr,type)){
- if(v->domain!=dom0&&type==DSIDE_TLB && __gpfn_is_io(v->domain, data->ppn>>(PAGE_SHIFT-12))){
+ if(v->domain!=dom0&&type==DSIDE_TLB && __gpfn_is_io(v->domain,data->ppn>>(PAGE_SHIFT-12))){
vadr=(vadr&((1UL<<data->ps)-1))+(data->ppn>>(data->ps-12)<<data->ps);
emulate_io_inst(v, vadr, data->ma);
return IA64_FAULT;
}
+
if ( data->ps != vrr.ps ) {
machine_tlb_insert(v, data);
}
* Copyright (C) 2005 Intel Co
* Kun Tian (Kevin Tian) <kevin.tian@intel.com>
*
- * 05/04/29 Kun Tian (Kevin Tian) <kevin.tian@intel.com> Add CONFIG_VTI domain support
+ * 05/04/29 Kun Tian (Kevin Tian) <kevin.tian@intel.com> Add VTI domain support
*/
#include <xen/config.h>
d->max_pages = (128UL*1024*1024)/PAGE_SIZE; // 128MB default // FIXME
-#ifdef CONFIG_VTI
- /* Per-domain vTLB and vhpt implementation. Now vmx domain will stick
- * to this solution. Maybe it can be deferred until we know created
- * one as vmx domain */
- v->arch.vtlb = init_domain_tlb(v);
-#endif
-
/* We may also need emulation rid for region4, though it's unlikely
* to see guest issue uncacheable access in metaphysical mode. But
* keep such info here may be more sane.
regs->ar_fpsr = FPSR_DEFAULT;
if (VMX_DOMAIN(v)) {
-#ifdef CONFIG_VTI
vmx_init_all_rr(v);
if (d == dom0)
// VCPU(v,vgr[12]) = dom_fw_setup(d,saved_command_line,256L);
/* Virtual processor context setup */
VCPU(v, vpsr) = IA64_PSR_BN;
VCPU(v, dcr) = 0;
-#endif
} else {
init_all_rr(v);
if (d == dom0)
}
else printk("map_domain_page: mpaddr %lx already mapped!\n",mpaddr);
}
-
+#if 0
/* map a physical address with specified I/O flag */
void map_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long flags)
{
}
else printk("map_domain_page: mpaddr %lx already mapped!\n",mpaddr);
}
-
+#endif
void mpafoo(unsigned long mpaddr)
{
extern unsigned long privop_trace;
}
// FIXME: ONLY USE FOR DOMAIN PAGE_SIZE == PAGE_SIZE
-#ifndef CONFIG_VTI
+#if 1
unsigned long domain_mpa_to_imva(struct domain *d, unsigned long mpaddr)
{
unsigned long pte = lookup_domain_mpa(d,mpaddr);
imva |= mpaddr & ~PAGE_MASK;
return(imva);
}
-#else // CONFIG_VTI
+#else
unsigned long domain_mpa_to_imva(struct domain *d, unsigned long mpaddr)
{
unsigned long imva = __gpa_to_mpa(d, mpaddr);
return __va(imva);
}
-#endif // CONFIG_VTI
+#endif
// remove following line if not privifying in memory
//#define HAVE_PRIVIFY_MEMORY
if ( rc != 0 )
return rc;
-#ifdef CONFIG_VTI
+#ifdef VALIDATE_VT
/* Temp workaround */
if (running_on_sim)
dsi.xen_section_string = (char *)1;
for ( i = 1; i < MAX_VIRT_CPUS; i++ )
d->shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
-#ifdef CONFIG_VTI
+#ifdef VALIDATE_VT
/* Construct a frame-allocation list for the initial domain, since these
* pages are allocated by boot allocator and pfns are not set properly
*/
machine_to_phys_mapping[mfn] = mfn;
}
- /* Dom0's pfn is equal to mfn, so there's no need to allocate pmt
- * for dom0
- */
- d->arch.pmt = NULL;
#endif
/* Copy the OS image. */
void sync_vcpu_execstate(struct vcpu *v)
{
ia64_save_fpu(v->arch._thread.fph);
-#ifdef CONFIG_VTI
if (VMX_DOMAIN(v))
vmx_save_state(v);
-#else
- if (0) do {} while(0);
-#endif
else {
if (IA64_HAS_EXTRA_STATE(v))
ia64_save_extra(v);
-#ifndef CONFIG_VTI
// temporarily in arch/ia64 until can merge into common/grant_table.c
/******************************************************************************
* common/grant_table.c
{
/* Nothing. */
}
-#endif
/*
* Local variables:
regs->r8 = do_event_channel_op(regs->r14);
break;
-#ifndef CONFIG_VTI
case __HYPERVISOR_grant_table_op:
regs->r8 = do_grant_table_op(regs->r14, regs->r15, regs->r16);
break;
-#endif
case __HYPERVISOR_console_io:
regs->r8 = do_console_io(regs->r14, regs->r15, regs->r16);
return IA64_ILLOP_FAULT;
}
//if (isrcode != 1 && isrcode != 2) return 0;
- vcpu_set_regs(vcpu,regs);
privlvl = (ipsr & IA64_PSR_CPL) >> IA64_PSR_CPL0_BIT;
// its OK for a privified-cover to be executed in user-land
fault = priv_handle_op(vcpu,regs,privlvl);
unsigned long rr7;
//printk("current=%lx,shared_info=%lx\n",current,current->vcpu_info);
//printk("next=%lx,shared_info=%lx\n",next,next->vcpu_info);
-#ifdef CONFIG_VTI
/* rr7 will be postponed to last point when resuming back to guest */
- vmx_load_all_rr(current);
-#else // CONFIG_VTI
- if (rr7 = load_region_regs(current)) {
- printk("schedule_tail: change to rr7 not yet implemented\n");
- }
-#endif // CONFIG_VTI
+ if(VMX_DOMAIN(current)){
+ vmx_load_all_rr(current);
+ }else{
+ if (rr7 = load_region_regs(current)) {
+ printk("schedule_tail: change to rr7 not yet implemented\n");
+ }
+ }
}
void tdpfoo(void) { }
{
struct mc_state *mcs = &mc_state[smp_processor_id()];
VCPU *vcpu = current;
- struct cpu_user_regs *regs = vcpu->arch.regs;
+ struct cpu_user_regs *regs = vcpu_regs(vcpu);
unsigned int i;
va_list args;
return 0;
}
-#ifdef CONFIG_VTI
+#if 0
memrrv.rrval = rrv.rrval;
if (rreg == 7) {
newrrv.rid = newrid;
return (IA64_ILLOP_FAULT);
}
-void vcpu_set_regs(VCPU *vcpu, REGS *regs)
-{
- vcpu->arch.regs = regs;
-}
/*
* Set up the page tables.
*/
-#ifdef CONFIG_VTI
unsigned long *mpt_table;
unsigned long mpt_table_size;
-#endif // CONFIG_VTI
void
paging_init (void)
{
struct pfn_info *pg;
-
-#ifdef CONFIG_VTI
unsigned int mpt_order;
/* Create machine to physical mapping table
* NOTE: similar to frame table, later we may need virtually
printk("machine to physical table: 0x%lx\n", (u64)mpt_table);
memset(mpt_table, INVALID_M2P_ENTRY, mpt_table_size);
-#endif // CONFIG_VTI
-
/* Other mapping setup */
zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
void sync_lazy_execstate_cpu(unsigned int cpu) {}
-#ifdef CONFIG_VTI
+#if 0
int grant_table_create(struct domain *d) { return 0; }
void grant_table_destroy(struct domain *d) { return; }
#endif
raise_softirq(AC_TIMER_SOFTIRQ);
}
-#ifndef CONFIG_VTI
unsigned long
__gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
{
return ((pte & _PFN_MASK) >> PAGE_SHIFT);
}
}
-
+#if 0
u32
__mfn_to_gpfn(struct domain *d, unsigned long frame)
{
//if (prev->domain->domain_id == 1 && next->domain->domain_id == 0) cs10foo();
//if (prev->domain->domain_id == 0 && next->domain->domain_id == 1) cs01foo();
//printk("@@sw %d->%d\n",prev->domain->domain_id,next->domain->domain_id);
-#ifdef CONFIG_VTI
- vtm_domain_out(prev);
-#endif
+ if(VMX_DOMAIN(prev)){
+ vtm_domain_out(prev);
+ }
context_switch_count++;
switch_to(prev,next,prev);
-#ifdef CONFIG_VTI
- vtm_domain_in(current);
-#endif
+ if(VMX_DOMAIN(current)){
+ vtm_domain_in(current);
+ }
// leave this debug for now: it acts as a heartbeat when more than
// one domain is active
if (!i--) { printk("+",id); i = 1000000; }
}
-#ifdef CONFIG_VTI
- if (VMX_DOMAIN(current))
+ if (VMX_DOMAIN(current)){
vmx_load_all_rr(current);
-#else
- if (!is_idle_task(current->domain)) {
- load_region_regs(current);
- if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
- }
- if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
-#endif
+ }else{
+ if (!is_idle_task(current->domain)) {
+ load_region_regs(current);
+ if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+ }
+ if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+ }
}
void context_switch_finalise(struct vcpu *next)
access_ok(type,addr,count*size))
// see drivers/char/console.c
-#ifndef CONFIG_VTI
+#ifndef VALIDATE_VT
#define OPT_CONSOLE_STR "com1"
-#else // CONFIG_VTI
+#else
#define OPT_CONSOLE_STR "com2"
-#endif // CONFIG_VTI
+#endif
#define __attribute_used__ __attribute__ ((unused))
#define __nocast
int breakimm;
int imp_va_msb;
- unsigned long *pmt; /* physical to machine table */
/* System pages out of guest memory, like for xenstore/console */
unsigned long sys_pgnr;
unsigned long max_pfn; /* Max pfn including I/O holes */
unsigned long xen_itm;
unsigned long xen_timer_interval;
#endif
- void *regs; /* temporary until find a better way to do privops */
mapped_regs_t *privregs; /* save the state of vcpu */
int metaphysical_rr0; // from arch_domain (so is pinned)
int metaphysical_rr4; // from arch_domain (so is pinned)
#define IA64_DISIST_FAULT (IA64_GENEX_VECTOR | 0x40)
#define IA64_ILLDEP_FAULT (IA64_GENEX_VECTOR | 0x80)
#define IA64_DTLB_FAULT (IA64_DATA_TLB_VECTOR)
-#define IA64_VHPT_FAULT (IA64_VHPT_TRANS_VECTOR | 0x10)
+#define IA64_VHPT_FAULT (IA64_VHPT_TRANS_VECTOR | 0x7)
#if !defined(__ASSEMBLY__)
typedef unsigned long IA64FAULT;
typedef unsigned long IA64INTVECTOR;
static inline void put_page(struct pfn_info *page)
{
-#ifdef CONFIG_VTI // doesn't work with non-VTI in grant tables yet
+#ifdef VALIDATE_VT // doesn't work with non-VTI in grant tables yet
u32 nx, x, y = page->count_info;
do {
static inline int get_page(struct pfn_info *page,
struct domain *domain)
{
-#ifdef CONFIG_VTI
+#ifdef VALIDATE_VT
u64 x, nx, y = *((u64*)&page->count_info);
u32 _domain = pickle_domptr(domain);
extern unsigned long totalram_pages;
extern int nr_swap_pages;
-#ifdef CONFIG_VTI
extern unsigned long *mpt_table;
#undef machine_to_phys_mapping
#define machine_to_phys_mapping mpt_table
/* If pmt table is provided by control pannel later, we need __get_user
* here. However if it's allocated by HV, we should access it directly
*/
-#define get_mfn_from_pfn(d, gpfn) \
- ((d) == dom0 ? gpfn : \
- (gpfn <= d->arch.max_pfn ? (d)->arch.pmt[(gpfn)] : \
- INVALID_MFN))
#define __mfn_to_gpfn(_d, mfn) \
machine_to_phys_mapping[(mfn)]
#define __gpfn_to_mfn(_d, gpfn) \
- get_mfn_from_pfn((_d), (gpfn))
+ __gpfn_to_mfn_foreign((_d), (gpfn))
#define __gpfn_invalid(_d, gpfn) \
- (__gpfn_to_mfn((_d), (gpfn)) & GPFN_INV_MASK)
+ (lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT)) & GPFN_INV_MASK)
#define __gpfn_valid(_d, gpfn) !__gpfn_invalid(_d, gpfn)
/* Return I/O type if trye */
#define __gpfn_is_io(_d, gpfn) \
(__gpfn_valid(_d, gpfn) ? \
- (__gpfn_to_mfn((_d), (gpfn)) & GPFN_IO_MASK) : 0)
+ (lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT)) & GPFN_IO_MASK) : 0)
#define __gpfn_is_mem(_d, gpfn) \
(__gpfn_valid(_d, gpfn) ? \
- ((__gpfn_to_mfn((_d), (gpfn)) & GPFN_IO_MASK) == GPFN_MEM) : 0)
+ (lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT) & GPFN_IO_MASK) == GPFN_MEM) : 0)
-#define __gpa_to_mpa(_d, gpa) \
- ((__gpfn_to_mfn((_d),(gpa)>>PAGE_SHIFT)<<PAGE_SHIFT)|((gpa)&~PAGE_MASK))
-#endif // CONFIG_VTI
+//#define __gpa_to_mpa(_d, gpa) \
+// ((__gpfn_to_mfn((_d),(gpa)>>PAGE_SHIFT)<<PAGE_SHIFT)|((gpa)&~PAGE_MASK))
#endif /* __ASM_IA64_MM_H__ */
#define _XEN_IA64_PRIVOP_H
#include <asm/ia64_int.h>
-//#ifdef CONFIG_VTI
#include <asm/vmx_vcpu.h>
-//#else //CONFIG_VTI
#include <asm/vcpu.h>
-//#endif //CONFIG_VTI
typedef unsigned long IA64_INST;
extern u64 set_isr_for_na_inst(VCPU *vcpu, int op);
-/* next all for CONFIG_VTI APIs definition */
+/* next all for VTI domain APIs definition */
extern void vmx_vcpu_set_psr(VCPU *vcpu, unsigned long value);
extern UINT64 vmx_vcpu_sync_mpsr(UINT64 mipsr, UINT64 value);
extern void vmx_vcpu_set_psr_sync_mpsr(VCPU * vcpu, UINT64 value);
vmx_vcpu_set_itm(VCPU *vcpu, u64 val)
{
vtime_t *vtm;
-
vtm=&(vcpu->arch.arch_vmx.vtm);
VCPU(vcpu,itm)=val;
-#ifdef CONFIG_VTI
vtm_interruption_update(vcpu, vtm);
-#endif
return IA64_NO_FAULT;
}
static inline
IA64FAULT
vmx_vcpu_set_eoi(VCPU *vcpu, u64 val)
{
-#ifdef CONFIG_VTI
guest_write_eoi(vcpu);
-#endif
return IA64_NO_FAULT;
}
{
VCPU(vcpu,itv)=val;
-#ifdef CONFIG_VTI
vtm_set_itv(vcpu);
-#endif
return IA64_NO_FAULT;
}
static inline
static inline
IA64FAULT vmx_vcpu_set_itc(VCPU *vcpu, UINT64 val)
{
-#ifdef CONFIG_VTI
vtm_set_itc(vcpu, val);
-#endif
return IA64_NO_FAULT;
}
static inline
IA64FAULT vmx_vcpu_get_itc(VCPU *vcpu,UINT64 *val)
{
-#ifdef CONFIG_VTI
*val = vtm_get_itc(vcpu);
-#endif
return IA64_NO_FAULT;
}
static inline
#define IA64_HAS_EXTRA_STATE(t) 0
#undef __switch_to
-#ifdef CONFIG_VTI
+#if 1
extern struct task_struct *vmx_ia64_switch_to (void *next_task);
#define __switch_to(prev,next,last) do { \
ia64_save_fpu(prev->arch._thread.fph); \
if (IA64_HAS_EXTRA_STATE(next)) \
ia64_save_extra(next); \
} \
- ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \
- (last) = vmx_ia64_switch_to((next)); \
+ /*ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next);*/ \
+ (last) = ia64_switch_to((next)); \
+ if (!VMX_DOMAIN(current)){ \
+ vcpu_set_next_timer(current); \
+ } \
} while (0)
-#else // CONFIG_VTI
+#else
#define __switch_to(prev,next,last) do { \
ia64_save_fpu(prev->arch._thread.fph); \
ia64_load_fpu(next->arch._thread.fph); \
(last) = ia64_switch_to((next)); \
vcpu_set_next_timer(current); \
} while (0)
-#endif // CONFIG_VTI
+#endif
#undef switch_to
// FIXME SMP... see system.h, does this need to be different?
// FIXME: tmp[8] temp'ly being used for virtual psr.pp
};
};
-#if 0
-#ifdef CONFIG_VTI
unsigned long reserved6[3456];
unsigned long vmm_avail[128];
unsigned long reserved7[4096];
-#endif
-#endif
} mapped_regs_t;
typedef struct {